import CryptoJS from "crypto-js";

export function hash(keyStr, data){
  const key = CryptoJS.enc.Utf8.parse(keyStr);
  const srcs = CryptoJS.enc.Utf8.parse(JSON.stringify(data));
  const target = CryptoJS.AES.encrypt(srcs, key, { mode: CryptoJS.mode.ECB, pad: CryptoJS.pad.Pkcs7 });
  return { portalReq: target.toString() }
}